export default{
  namespaced:true,
  state:{
    // 用户的收货地址
    address:uni.getStorageSync('address') || {}
  },
  mutations:{
    // 保存地址信息
    setAddress(state,addressObj){
      state.address=addressObj
      uni.setStorageSync('address',state.address)
    }
  },
  actions:{},
  getters:{
    fullAddress(state) {
      // 判断数据是否存在
      if (!state.address.provinceName) return ''
      return state.address.provinceName + state.address.cityName + state.address.countyName + state.address.detailInfo
    }
  }
}